﻿using Appliaction.Dto.Sinv;
using Domain.Entitys.Sinv;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Appliaction.IAppServices.Sinv
{
    public interface ISinv_Sale_ReturnService
    {
        /// <summary>
        /// 分页条件查询销售退货订单
        /// </summary>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        List<Sinv_Sale_Return_Info> GetSinv_Sale_Return_Infos(int currentPage, int pageSize, string customerName, string orderCode, int orderStatus, char auditStatus);

        /// <summary>
        /// 条件查询销售订单总数
        /// </summary>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnCountAsync(string customerName, string orderCode, int orderStatus, char auditStatus);

        /// <summary>
        /// 添加销售退货信息及其详情
        /// </summary>
        /// <param name="saleReturnWithDetailsDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnAddAsync(SaleReturnWithDetailsDto saleReturnWithDetailsDto);

        /// <summary>
        /// 根据销售退货编号查询对应销售退货信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<Sinv_Sale_Return> Sinv_Sale_ReturnByCodeAsync(string code);

        /// <summary>
        /// 根据销售退货编号查询对应销售退货明细
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<List<Sinv_Sale_Return_Details>> Sinv_Sale_Return_DetailsByCodeAsync(string code);

        /// <summary>
        /// 修改销售明细及其详情
        /// </summary>
        /// <param name="saleReturnWithDetailsUpdateDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnUpdateAsync(SaleReturnWithDetailsUpdateDto saleReturnWithDetailsUpdateDto);

        /// <summary>
        /// 修改订单审核状态、增加库存、修改销售明细退货数量、修改销售订单状态
        /// </summary>
        /// <param name="sinv_Sale_ReturnAuditUpdateDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnAuditUpdateAsync(Sinv_Sale_ReturnAuditUpdateDto sinv_Sale_ReturnAuditUpdateDto);

        /// <summary>
        /// 逻辑删除销售退货信息并修改销售明细预计退货数量
        /// </summary>
        /// <param name="sinv_Sale_ReturnDelDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_ReturnDelAsync(Sinv_Sale_ReturnDelDto sinv_Sale_ReturnDelDto);
    }
}
